package com.imcode.listdemo;

import java.util.LinkedList;
import java.util.List;

/**
 * 模拟队列
 * 先进先出
 */
public class LinkedListDemo02 {
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();
        list.addLast("001");
        list.addLast("002");
        list.addLast("003");
        list.addLast("004");
        System.out.println(list);

        System.out.println(list.removeFirst());
        System.out.println(list.removeFirst());
        System.out.println(list.removeFirst());
        System.out.println(list.removeFirst());
        System.out.println(list);
    }
}
